package com.kgc.kmall.kmallcloudmanagerweb.controller;

import com.kgc.kmall.bean.PmsBaseSaleAttr;
import com.kgc.kmall.bean.PmsProductInfo;
import com.kgc.kmall.bean.PmsProductSaleAttr;
import com.kgc.kmall.kmallcloudmanagerweb.service.SpuFeignService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
public class SpuController {
    @Resource
    SpuFeignService spuFeignService;

    @RequestMapping("/spuList")
    public List<PmsProductInfo> spuList(Long catalog3Id){
        return spuFeignService.spuList(catalog3Id);
    }

    //根据id查询spu
    @RequestMapping("/spuSaleAttrList")
    public List<PmsProductSaleAttr> spuSaleAttrList(Long spuId){
        return spuFeignService.spuSaleAttrList(spuId);
    }
}
